﻿{#template MAIN}
<table id="gridBooking" cellpadding="5" cellspacing="0" class="grid">
    <thead>
        <tr>
            <th rowspan="2">
                No.
            </th>
            <th rowspan="2">
                Full Name
            </th>
            <th rowspan="2">
                Dept
            </th>
            <th colspan="2">
                Time
            </th>
            <th colspan="2">
                Date
            </th>
            <th rowspan="2">
                Car
            </th>
            <th rowspan="2">
                Destination
            </th>
            <th rowspan="2">
                Purpose
            </th>
            <th rowspan="2">
                Requested Date
            </th>
            <th rowspan="2">
                Remark
            </th>
            {#if $T.ShowStatus}
            <th rowspan="2">
                Status
            </th>
            {#else}
            <th rowspan="2">
                <input type="checkbox" id="allChoice" />
            </th>
            {#/if}
        </tr>
        <tr>
            <th>
                From (hh:mm)
            </th>
            <th>
                To (hh:mm)
            </th>
            <th>
                From (dd/mm)
            </th>
            <th>
                To (dd/mm)
            </th>
        </tr>
    </thead>
    <tbody>
        {#foreach $T.List as booking}
        <tr class="{#cycle values=['','evenRow']}" id="{$T.booking.BookingID}">
            <td align="center" style="width: 25px">
                <a href='javascript:void(0)' class="button-view">{$T.booking$index + 1 + ($T.PageNumber
                    - 1) * $T.PageSize} </a>
            </td>
            {#include ROW root=$T.booking} {#if $T.ShowStatus}
            <td class="status" style="width: 25px">
                {$T.booking.Status}
            </td>
            {#else}
            <td style="width: 25px">
                <input type="checkbox" class="choice" />
            </td>
            <td style="width: 25px">
                <a href='javascript:void(0)' class="{#if !$T.booking.IsApproval}button-approve{#else}button-edit{#/if}">
                </a>
            </td>
            {#/if}
        </tr>
        {#/for}
    </tbody>
</table>
{#/template MAIN} {#template ROW}
<td>
    {$T.FullName}
</td>
<td style="width: 25px">
    {$T.Department}
</td>
<td style="width: 25px">
    {$T.FromTime}
</td>
<td style="width: 25px">
    {$T.ToTime}
</td>
<td style="width: 25px">
    {$T.FromDate}
</td>
<td style="width: 25px">
    {$T.ToDate}
</td>
<td style="width: 25px">
    {$T.CarName} <img src='{$T.CarURL}' alt='{$T.CarName}' width="20" />
</td>
<td style="width: 25px">
    {$T.Destination}
</td>
<td style="width: 25px">
    {$T.Purpose}
</td>
<td style="width: 25px">
    {$T.RequestDate}
</td>
<td style="width: 25px">
    {$T.Remark}
</td>
{#/template ROW}